<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String text = request.getParameter("finduser");
String UserNumber="";
if(text==null){
    text="";
}
else {
    UserNumber = text;
}
String flag = request.getParameter("flag");
if(flag==null){
    flag="none";
}
if("".equals(text)){
    flag="none";
}
String flag1="";
if("none".equals(flag)){
    flag1="block";
} else if("block".equals(flag)){
    flag1="none";
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>用户管理 - 同学录 </title>
    
	<meta name="title" content="登录  - 同学录" >
	<meta name="description" content="毕业后，又有多少人与同学断了联系" >
	<meta name="keywords" content="留言" >
    <meta http-equiv="Cache-Control" content="no-cache,no-transform,no-siteapp" />
	<meta http-equiv="Pragma" content="no-cache" />	<meta http-equiv="Expires" content="0" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

	<link href="images/t1-1.png" type="image/x-icon" rel="shortcut icon">

	
	<script src="js/alert.js" type="text/javascript"></script>
	
	<link rel="stylesheet" type="text/css" href="css/footer.css" >
	<link href="css/picpas.css" rel="stylesheet">
	<link href="css/all.css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="css/style.css">
	
  </head>
 
  
<body id="tuchong-com" class="default-p has-subnav" width="100%" style="position:relative;">
<style>
	body{
		background:url(images/background.jpg) top left;
		background-size:100% 110%;
	}
</style>
<div>
	<%@ include file="header.jsp" %>
</div>
<style>
.navbar-global a {
color: #ccc;
}
</style>



<div class="container" style="margin-bottom:0px; ">
    <div class="nav-search" style="margin-left:985px;">
		<form action="usermanage.jsp" method="get">
		      <input type="hidden" id="flag" name="flag" value="block">
              <input  type="text" placeholder="请输入用户账号" id="finduser" name="finduser" value="<%=text%>">
              <button type="submit" class="btn btn-sm btn-primary">查询</button>
        </form>
	</div>
	<div class="hr_black" >
		<div class="button-holder" style="margin-top:10px; float:right">

	    </div>
	</div>
</div>
 <div style="width:100%;height:56.8%;display:<%=flag1 %>;">

 </div>
<%@ page import= "java.sql.*"%>
<%@ page import= "com.connect.connect"%>
<%
    connect conn =new connect();
	Connection con = conn.con();
	String UserName="";
	String UserSex="";
	String Birthdate="";String year="";String month="";String day="";
	String Zodiac="";
	String UserPhone="";
	String UserEmail="";
	String University="";
	String Fication="";
	String Time="";
	
	ResultSet rs;
	try{
		Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
	    rs=stmt.executeQuery("SELECT * FROM person WHERE UserNumber ='"+UserNumber+"'");
	    if(rs.next()){
	        UserNumber = rs.getString("UserNumber");
	        UserName=rs.getString("UserName");
	        UserSex=rs.getString("UserSex");
	        Birthdate=rs.getString("Birthdate");
	        Zodiac=rs.getString("Zodiac");
	        UserPhone=rs.getString("UserPhone");
	        UserEmail=rs.getString("UserEmail");
	        University=rs.getString("University");
	        Fication=rs.getString("Fication");
	        Time=rs.getString("Time");
	    } else {
	        if("".equals(text)){
	            UserNumber = "";
	        } else {
	            UserNumber = "0";
	        }
	    }
	    con.close();
	}catch(SQLException e){
		e.printStackTrace();
    }
    if(Birthdate.equals("")){
    } else {
        year=Birthdate.substring(0,4);
        month=Birthdate.substring(5,7);
        day=Birthdate.substring(8,10);
    }
%>

<%
if("0".equals(UserNumber)){
 %>
 <div style="width:100%;height:56.8%">

     <center><span style="font-size:0xp;color:red">对不起，查无此人!</span></center>
 </div>
<%
} else {
 %>
<div id="User" class="container container-default" style="margin-left:300px;margin-top:40px;display:<%=flag %>;" >	
<main role="main" class="col-main">
 	<section class="with-bg">
		<h1 class="card-header-larger">用户信息</h1>
        <form id="regForm" class="form-horizontal form-mobile inner" action="person.do" method="post" style="margin-left:100px">
			
	        <input type="hidden" id="from" name="from" value="1">
	        <input type="hidden" id="usernumber" name="usernumber" value="<%=UserNumber%>">
	        <div class="form-group">
				<label class="col-xs-2 control-label" for="regname"><em style="color:#FF0000; font-size:16px" >*</em>用户账号</label>
				<div class="col-xs-6">
					<input type="text" class="form-control" name="number" id="number" placeholder="请输入您的账号 " value="<%=UserNumber %>" required autofocus/>
				</div>
			</div>	
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regname">真实姓名</label>
				<div class="col-xs-6">
					<input type="text" class="form-control" name="name" id="name" placeholder="请输入您的真实姓名 " value="<%=UserName %>" />
				</div>
			</div>		
			
			<div class="form-group form-group-mobile">
				<label class="col-xs-2 control-label" for="regMobile">性别</label>
				<div class="col-xs-6">
					<select id="zone" name="zone" style="width:120px;" class="form-control"/>
					<%
					    if("1".equals(UserSex)){
					%>
						<option value="2">请选择性别</option>
						<option value="1" selected="selected">男</option>
						<option value="0">女</option>
					<%
					    } else if("0".equals(UserSex)){
					%>
						<option value="2">请选择性别</option>
						<option value="1">男</option>
						<option value="0" selected="selected">女</option>					
					<%
					    } else {
					%>
						<option value="2" selected="selected">请选择性别</option>
						<option value="1" >男</option>
						<option value="0">女</option>
					<% 
					    }
					%>
					</select>
					<span class="help-block" id="sex_inner" style="color:#FF0000"></span>
				</div>	
			</div>
			
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regbith">出生日期</label>
				<div class="col-xs-2">
					<input type="text" class="form-control" maxlength="4"  style="width:100px;" name="year"  id="year" placeholder="年" value="<%=year %>"/>
				</div>
				<div class="col-xs-0">
					<span class="help-block">-</span>
				</div>
				<div class="col-xs-1">
					<input type="text" class="form-control" maxlength="2"  style="width:45px;" name="month"  id="month" placeholder="月" value="<%=month %>"/>
				</div>
				<div class="col-xs-0">
					<span class="help-block">-</span>
				</div>
				<div class="col-xs-1">					
					<input type="text" class="form-control" maxlength="2"  style="width:45px;" name="day"  id="day" placeholder="日" value="<%=day %>"/>
				</div>
			</div>
			
			
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regzodiac">星座</label>
				<div class="col-xs-6">
					<input type="text" name="zodiac" id="zodiac" class="form-control" placeholder="请输入您的星座" value="<%=Zodiac%>"/>
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regphone">手机号</label>
				<div class="col-xs-6">
					<input type="text" name="userphone"  id="userphone" class="form-control" placeholder="请输入您的手机号" value="<%=UserPhone%>"/>
				</div>	
			</div>
			
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regemail">邮箱</label>
				<div class="col-xs-6">
					<input type="text" name="useremail" id="useremail" class="form-control" placeholder="请输入您的邮箱" value="<%=UserEmail%>"/>
				</div>
			</div>	
					
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regschool">所在学校</label>
				<div class="col-xs-6">
					<input type="text" name="university" id="university" class="form-control" placeholder="请输入您的学校" value="<%=University%>"/>
				</div>
			</div>		
			
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regfication">个人说明</label>
				<div class="col-xs-6">
					<input type="text" name="fication" id="fication" class="form-control" placeholder="不超过15字" value="<%=Fication%>"/>
				</div>
			</div>	
			
			<div class="form-group">
				<label class="col-xs-2 control-label" for="regtime">注册时间</label>
                <div class="col-xs-6">
                     <span class="help-block"><%="  "+Time %></span>
                </div>
			</div>
						
			<div class="form-group">
				<div class="col-xs-offset-2 col-xs-10" style="padding-top:10px">
					<button type="submit" class="btn btn-sm btn-primary"  >修改</button>
					&nbsp;&nbsp;点击&nbsp;<a style="color: blue"href="index.jsp" >返回</a>&nbsp;到首页&nbsp;&nbsp;&nbsp;
				</div>
			</div>
		</form>
	</section>
<%
}
%>

</main>
</div>


<%@ include file="footer.jsp" %>

<!--[if lt IE 9]>
<iframe class="bc-warn" src="browsercheck.html" frameborder="0"></iframe>
<div class="bc-screen-lock"></div>
<link href="http://static.tuchong.net/styles/ie-checker.css?1435126808.css" rel="stylesheet" />
<![endif]-->
<div class="back-to-top direction-caret big"></div>


</body> 
</html>
